package com.api.league.service;

import com.api.core.service.Service;
import com.api.league.enums.LeagueStatus;
import com.api.league.form.CreateLeagueForm;
import com.api.league.model.League;
import com.api.league.vo.LeagueTopPlayerVo;
import com.api.league.vo.LeagueVo;

import java.util.List;

/**
 * @author RenQiang
 * @date 2021/5/26
 */
public interface LeagueService extends Service<League> {
    /**
     * 创建联赛
     *
     * @param form
     */
    void createLeague(CreateLeagueForm form);

    /**
     * 根据游戏分类查询联赛
     *
     * @param gameCategoryId
     * @param leagueStatus
     * @return
     */
    List<LeagueVo> findByGameCategoryId(Long gameCategoryId, LeagueStatus leagueStatus);

    /**
     * 删除联赛以及关联数据
     *
     * @param leagueId
     */
    void deleteLeague(Long leagueId);

    /**
     * 获取所有Top玩家
     *
     * @param leagueId
     * @return
     */
    List<LeagueTopPlayerVo> getTopPlayers(Long leagueId);

    /**
     * 更新Top玩家
     *
     * @param leagueId
     * @param rank
     * @param teamId
     * @param playerId
     */
    void updateTopPlayer(Long leagueId, Integer rank, Long teamId, Long playerId);

    /**
     * 归档联赛
     *
     * @param leagueId
     */
    void archiveById(Long leagueId);
}
